export const reLaunch = (url) => uni.reLaunch({ url, fail: e => console.log(e) });
export const navigateTo = (
  url,
  animationType = "pop-out",
  animationDuration = 300
) => uni.navigateTo({ url, animationType, animationDuration });
export const switchTab = (url) => uni.switchTab({ url });
export const redirectTo = (url) => uni.redirectTo({ url });
export const navigateBack = (
  delta = -1,
  animationType = "pop-out",
  animationDuration = 300
) => uni.navigateBack({ delta, animationType, animationDuration });

export const getCurrentPath = () => {
  const pages = getCurrentPages()
  return (pages[pages.length - 1] || { route: '' }).route
}
